from flask import Flask,request

app = Flask(__name__)

# 定义接口
@app.route("/login", methods=["POST"])
def login():
    name = request.form.get("username")
    pwd = request.form.get("password")
    if name == "admin" and pwd == "123456":
        return {"status": 200, "msg": "登录成功", "token": "xxx123123123"}
    return {"status": 100, "msg": "用户名密码错误"}

if __name__ == '__main__':
    app.run(debug=True)